In this article, we study connections between components of the Cayley GRAPH Cay(G, A), where A is an arbitrary subset of a group G, and cosets of the subgroup of G generated by A. In particular, we show how to construct generating sets of G if Cay(G, A) has finitely many components. Furthermore, we provide an algorithm for finitely minimal generating sets of finite groups using their Cayley GRAPHs.